package seed_partner_admin

import (
	"fmt"
	"gitee.com/theegg/go-brick/app/model/partner/partner_admin/partner_admin_menus"
	"gitee.com/theegg/go-brick/app/service/app"
)

var PartnerAdminMenusSeedData = make(map[int]partner_admin_menus.PartnerAdminMenus)

func InitPartnerAdminMenuSeed() {
	PartnerAdminMenusSeedData[200000] = partner_admin_menus.PartnerAdminMenus{
		Id:        200000,
		Pid:       0,
		Title:     "系统管理",
		TitleSign: "system_manage",
		Route:     "",
		Sort:      0,

		Icon:   "fa fa-lg fa-fw fa-cog",
		Path:   "admin",
		Status: 1,
	}

	PartnerAdminMenusSeedData[201000] = partner_admin_menus.PartnerAdminMenus{
		Id:        201000,
		Pid:       200000,
		Title:     "系统管理员",
		TitleSign: "system_admin",
		Route:     "admin/user/list",
		Sort:      0,
		Icon:      "",
		Path:      "admin/user/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[202000] = partner_admin_menus.PartnerAdminMenus{
		Id:        202000,
		Pid:       200000,
		Title:     "系统角色",
		TitleSign: "system_role",
		Route:     "admin/role/list",
		Sort:      1,

		Icon:   "",
		Path:   "admin/role/list",
		Status: 1,
	}

	PartnerAdminMenusSeedData[203000] = partner_admin_menus.PartnerAdminMenus{
		Id:        203000,
		Pid:       200000,
		Title:     "系统日志",
		TitleSign: "system_log",
		Route:     "admin/log/list",
		Sort:      1,

		Icon:   "",
		Path:   "admin/log/list",
		Status: 1,
	}

	PartnerAdminMenusSeedData[204000] = partner_admin_menus.PartnerAdminMenus{
		Id:        204000,
		Pid:       200000,
		Title:     "系统权限",
		TitleSign: "system_permission",
		Route:     "admin/permission/list",
		Sort:      0,

		Icon: "",
		Path: "admin/permission/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[206000] = partner_admin_menus.PartnerAdminMenus{
		Id:        206000,
		Pid:       200000,
		Title:     "系统配置",
		TitleSign: "system_configure",
		Route:     "system/configures/list",
		Sort:      0,

		Icon: "",
		Path: "system/configures/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[207000] = partner_admin_menus.PartnerAdminMenus{
		Id:        207000,
		Pid:       200000,
		Title:     "system_module",
		TitleSign: "system_module",
		Route:     "system/modules/list",
		Sort:      0,

		Icon: "",
		Path: "system/modules/list",

		Status: 1,
	}

	/*** ============= 菜单 ============= */
	PartnerAdminMenusSeedData[205000] = partner_admin_menus.PartnerAdminMenus{
		Id:        205000,
		Pid:       200000,
		Title:     "系统菜单",
		TitleSign: "system_menu",
		Route:     "admin/menu/list",
		Sort:      1,
		Icon:      "",
		Path:      "admin/menu/list",

		Status: 1,
	}

	/** =============== 二手管理 ============== */
	PartnerAdminMenusSeedData[300000] = partner_admin_menus.PartnerAdminMenus{
		Id:        300000,
		Pid:       0,
		Title:     "二手管理",
		TitleSign: "secondhand_goods",
		Route:     "",
		Sort:      8,

		Icon: "fa fa-lg fa-fw fa-cog",
		Path: "sh",

		Status: 1,
	}

	PartnerAdminMenusSeedData[301000] = partner_admin_menus.PartnerAdminMenus{
		Id:        301000,
		Pid:       300000,
		Title:     "商品管理",
		TitleSign: "goods_manage",
		Route:     "sh/goods/list",
		Sort:      0,

		Icon:   "",
		Path:   "sh/goods/list",
		Status: 1,
	}

	PartnerAdminMenusSeedData[302000] = partner_admin_menus.PartnerAdminMenus{
		Id:        302000,
		Pid:       300000,
		Title:     "评论管理",
		TitleSign: "comment_manage",
		Route:     "sh/comment/list",
		Sort:      0,

		Icon:   "",
		Path:   "sh/comment/list",
		Status: 1,
	}

	/** =============== 内容管理 ============== */
	PartnerAdminMenusSeedData[400000] = partner_admin_menus.PartnerAdminMenus{
		Id:        400000,
		Pid:       0,
		Title:     "内容管理",
		TitleSign: "content_manage",
		Route:     "",
		Sort:      3,

		Icon: "fa fa-lg fa-fw fa-cog",
		Path: "content",

		Status: 1,
	}

	PartnerAdminMenusSeedData[401000] = partner_admin_menus.PartnerAdminMenus{
		Id:        401000,
		Pid:       400000,
		Title:     "内容列表",
		TitleSign: "content_list",
		Route:     "content/node/list",
		Sort:      0,

		Icon: "",
		Path: "content/node/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[402000] = partner_admin_menus.PartnerAdminMenus{
		Id:        402000,
		Pid:       400000,
		Title:     "评论列表",
		TitleSign: "comment_list",
		Route:     "content/node_comment/list",
		Sort:      2,

		Icon: "",
		Path: "content/node_comment/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[403000] = partner_admin_menus.PartnerAdminMenus{
		Id:        403000,
		Pid:       400000,
		Title:     "内容分类",
		TitleSign: "content_category",
		Route:     "content/node_category/list",
		Sort:      3,

		Icon: "",
		Path: "content/node_category/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[404000] = partner_admin_menus.PartnerAdminMenus{
		Id:        404000,
		Pid:       400000,
		Title:     "标签列表",
		TitleSign: "tag_list",
		Route:     "content/tags/list",

		Sort: 3,

		Icon:   "",
		Path:   "content/tags/list",
		Status: 1,
	}

	/** =============== 用户管理 ============== */
	PartnerAdminMenusSeedData[500000] = partner_admin_menus.PartnerAdminMenus{
		Id:        500000,
		Pid:       0,
		Title:     "用户管理",
		TitleSign: "user_manage",
		Route:     "",
		Sort:      2,

		Icon: "fa fa-lg fa-fw fa-cog",
		Path: "user",

		Status: 1,
	}

	PartnerAdminMenusSeedData[501000] = partner_admin_menus.PartnerAdminMenus{
		Id:        501000,
		Pid:       500000,
		Title:     "用户列表",
		TitleSign: "user_list",
		Route:     "user/list",
		Sort:      1,

		Icon: "",
		Path: "user/list",

		Status: 1,
	}
	PartnerAdminMenusSeedData[502000] = partner_admin_menus.PartnerAdminMenus{
		Id:        502000,
		Pid:       500000,
		Title:     "账户流转",
		TitleSign: "account_flow_list",
		Route:     "account_flow/list",
		Sort:      1,

		Icon: "",
		Path: "account_flow/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[503000] = partner_admin_menus.PartnerAdminMenus{
		Id:        503000,
		Pid:       500000,
		Title:     "用户角色",
		TitleSign: "user_role_list",
		Route:     "user/role/list",
		Sort:      1,

		Icon:   "",
		Path:   "user/role/list",
		Status: 1,
	}

	PartnerAdminMenusSeedData[504000] = partner_admin_menus.PartnerAdminMenus{
		Id:        504000,
		Pid:       500000,
		Title:     "用户权限",
		TitleSign: "user_permission_list",
		Route:     "user/permission/list",
		Sort:      1,

		Icon: "",
		Path: "user/permission/list",

		Status: 1,
	}

	PartnerAdminMenusSeedData[505000] = partner_admin_menus.PartnerAdminMenus{
		Id:        505000,
		Pid:       500000,
		Title:     "用户权限",
		TitleSign: "user_role_permission_list",
		Route:     "user/role/permission/list",
		Sort:      1,

		Icon: "",
		Path: "user/role/permission/list",

		Status: 1,
	}

	/** =============== 商家管理 ============== */
	PartnerAdminMenusSeedData[600000] = partner_admin_menus.PartnerAdminMenus{
		Id:        600000,
		Pid:       0,
		Title:     "商家管理",
		TitleSign: "merchant_manage",
		Route:     "",
		Sort:      4,

		Icon: "fa fa-lg fa-fw fa-cog",
		Path: "user",

		Status: 1,
	}

	PartnerAdminMenusSeedData[601000] = partner_admin_menus.PartnerAdminMenus{
		Id:        601000,
		Pid:       600000,
		Title:     "商家列表",
		TitleSign: "merchant_list",
		Route:     "commerce/merchant/list",
		Sort:      0,
		Icon:      "",
		Path:      "commerce/merchant/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[602000] = partner_admin_menus.PartnerAdminMenus{
		Id:        602000,
		Pid:       600000,
		Title:     "商品列表",
		TitleSign: "goods_list",
		Route:     "commerce/goods/list",
		Sort:      0,
		Icon:      "",
		Path:      "commerce/goods/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[603000] = partner_admin_menus.PartnerAdminMenus{
		Id:        603000,
		Pid:       600000,
		Title:     "商品集合",
		TitleSign: "goods_set",
		Route:     "commerce/goods_set/list",
		Sort:      0,
		Icon:      "",
		Path:      "commerce/goods_set/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[604000] = partner_admin_menus.PartnerAdminMenus{
		Id:        604000,
		Pid:       600000,
		Title:     "品牌列表",
		TitleSign: "brand_list",
		Route:     "commerce/brands/list",
		Sort:      0,
		Icon:      "",
		Path:      "commerce/brands/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[605000] = partner_admin_menus.PartnerAdminMenus{
		Id:        605000,
		Pid:       600000,
		Title:     "商品分类",
		TitleSign: "goods_category",
		Route:     "commerce/goods_category/list",
		Sort:      0,
		Icon:      "",
		Path:      "commerce/goods_category/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[606000] = partner_admin_menus.PartnerAdminMenus{
		Id:        606000,
		Pid:       600000,
		Title:     "订单列表",
		TitleSign: "order_list",
		Route:     "commerce/orders/list",
		Sort:      0,
		Icon:      "",
		Path:      "commerce/orders/list",
		Status:    1,
	}

	/** =============== 租户管理 ============== */
	PartnerAdminMenusSeedData[800000] = partner_admin_menus.PartnerAdminMenus{
		Id:        800000,
		Pid:       0,
		Title:     "城市综合",
		TitleSign: "urban_manage",
		Route:     "",
		Sort:      4,

		Icon: "fa fa-lg fa-fw fa-cog",
		Path: "urban",

		Status: 1,
	}

	PartnerAdminMenusSeedData[801000] = partner_admin_menus.PartnerAdminMenus{
		Id:        801000,
		Pid:       800000,
		Title:     "景点列表",
		TitleSign: "tour_list",
		Route:     "urban/tour/list",
		Sort:      0,
		Icon:      "",
		Path:      "urban/tour/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[802000] = partner_admin_menus.PartnerAdminMenus{
		Id:        802000,
		Pid:       800000,
		Title:     "餐厅列表",
		TitleSign: "restaurant_list",
		Route:     "urban/restaurant/list",
		Sort:      0,
		Icon:      "",
		Path:      "urban/restaurant/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[803000] = partner_admin_menus.PartnerAdminMenus{
		Id:        803000,
		Pid:       800000,
		Title:     "玩乐列表",
		TitleSign: "fun_list",
		Route:     "urban/fun/list",
		Sort:      0,
		Icon:      "",
		Path:      "urban/fun/list",
		Status:    1,
	}

	PartnerAdminMenusSeedData[804000] = partner_admin_menus.PartnerAdminMenus{
		Id:        804000,
		Pid:       800000,
		Title:     "便民列表",
		TitleSign: "convenient_list",
		Route:     "urban/convenient/list",
		Sort:      0,
		Icon:      "",
		Path:      "urban/convenient/list",
		Status:    1,
	}

	/** =============== 房屋管理 ============== */
	PartnerAdminMenusSeedData[900000] = partner_admin_menus.PartnerAdminMenus{
		Id:        900000,
		Pid:       0,
		Title:     "租售管理",
		TitleSign: "property_manage",
		Route:     "",
		Sort:      5,
		Icon:      "fa fa-lg fa-fw fa-cog",
		Path:      "property",
		Status:    1,
	}

	PartnerAdminMenusSeedData[901000] = partner_admin_menus.PartnerAdminMenus{
		Id:        901000,
		Pid:       900000,
		Title:     "租售列表",
		TitleSign: "property_list",
		Route:     "property/list",
		Sort:      0,
		Icon:      "",
		Path:      "property/list",
		Status:    1,
	}

	count := 0
	errCount := 0
	for _, user := range PartnerAdminMenusSeedData {
		_, err := app.Db().Insert(user)
		if err != nil {
			fmt.Println(err.Error())
			errCount++
		} else {
			count++
		}
	}

	fmt.Printf("%5s|%25s|%10d|%8d|\n", "", "partner_admin_menus", count, errCount)
}
